# Contributor: Newbyte <newbyte@disroot.org>
# Maintainer:
pkgname=py3-pydantic
pkgver=1.10.10
pkgrel=1
pkgdesc="Data parsing and validation using Python type hints"
url="https://github.com/samuelcolvin/pydantic"
arch="noarch"
license="MIT"
depends="py3-typing-extensions"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-hypothesis py3-pytest py3-pytest-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/samuelcolvin/pydantic/archive/refs/tags/v$pkgver.tar.gz
	deprecation-warning.patch"
builddir="$srcdir/pydantic-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
999bfe506e35f22772e7e473c5333c6dc30eb32ce1a99b9f76ee44fc6f9daee1ffa005ce02744a412175545d5c0ed6959a4b268da90ee2cd47554f811643a54b  py3-pydantic-1.10.10.tar.gz
20fe12362cbe6a7d9f393eea71f8aa968e4a09cd6e4594505a95f889b5ec27f06c1214ef8aa841f3aa5b57f6c9bb41fbe382ef7512724e5e0947e2e916f495c9  deprecation-warning.patch
"
